<template>
  <div>
    <n-h3>Dialog</n-h3>
    <n-button type="primary" @click="handleShowDialog">
      useDialog
    </n-button>
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue'
import { useDialog, useMessage } from 'naive-ui'

export default defineComponent({
	name: 'Message',
	setup () {
		const dialog = useDialog()
		const message = useMessage()
		const handleShowDialog = () => {
			dialog.success({
				title: 'Success use dialog',
				content: 'Cool',
				positiveText: 'Wow!',
				onPositiveClick: () => {
					message.success('Great!')
				},
			})
		}
		return {
			handleShowDialog,
		}
	},
})
</script>
